package com.elitel.frame.business.service.common;

import com.elitel.frame.business.service.common.exception.ServerRequestException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * 前置后置处理器
 *
 * @author mulis
 */
public interface CommonServerProcessor {


    /**
     * 请求之前的拦截
     *
     * @param params
     * @param request
     * @param response
     * @return
     */
    default void pre(Map params, HttpServletRequest request, HttpServletResponse response) {
    }


    /**
     * 请求之后的拦截
     *
     * @param params
     * @param request
     * @param response
     */
    default Object post(Map params, Object result, HttpServletRequest request, HttpServletResponse response) {
        return result;
    }
}
